﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.ExportToRTR.YAML.Planned
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using EngineeringInternalExtension;
using System.Collections.Generic;


namespace DnProcessSimulateCommands.ExportToRTR.YAML;

public class Planned : Connection
{
  public bool Dense;

  public int PlanningTime { get; set; }

  public double? MinimumClearance { get; set; }

  public override string GetConnectionTypeName() => "planned";

  public override bool AlmostEquals(Connection other, double epsilon)
  {
    bool flag1 = true;
    if (!this.GetConnectionTypeName().Equals(other.GetConnectionTypeName()))
      return false;
    Planned planned = (Planned) other;
    bool flag2 = flag1 & this.PlanningTime == planned.PlanningTime & this.Dense == planned.Dense;
    double? minimumClearance = this.MinimumClearance;
    if (!minimumClearance.HasValue)
    {
      minimumClearance = planned.MinimumClearance;
      if (!minimumClearance.HasValue)
        goto label_8;
    }
    minimumClearance = this.MinimumClearance;
    if (minimumClearance.HasValue)
    {
      minimumClearance = planned.MinimumClearance;
      if (minimumClearance.HasValue)
      {
        int num1 = flag2 ? 1 : 0;
        minimumClearance = this.MinimumClearance;
        double num2 = minimumClearance.Value;
        minimumClearance = planned.MinimumClearance;
        double num3 = minimumClearance.Value;
        double num4 = epsilon;
        int num5 = TxDoubleExtension.AlmostEquals(num2, num3, num4) ? 1 : 0;
        flag2 = (num1 & num5) != 0;
        goto label_8;
      }
    }
    return false;
label_8:
    if (this.RobotObstacles.Count != planned.RobotObstacles.Count)
      return false;
    for (int index = 0; index < this.RobotObstacles.Count; ++index)
      flag2 &= this.RobotObstacles[index].Equals(planned.RobotObstacles[index]);
    return flag2;
  }

  public List<RobotObstacle> RobotObstacles { get; set; } = new List<RobotObstacle>();
}
